<%--
  Created by IntelliJ IDEA.
  User: Yoyo-ba
  Date: 2021/10/31
  Time: 11:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>el表达式从域中取数据</title>
</head>
<body>
      <%--
        概念
          简化  jsp输出语句---获取域中数据并输出

        基本的格式
         ${域名.属性}
         简化格式
           直接写属性名
           //简写格式 遵循就近原则
           先去小的域中找 再去大的域中找
              page域<request域 < session域<servletContext(application)域
      --%>
      <%
         //设置一个数据
          request.setAttribute("rid","request");
          session.setAttribute("sid","session");

          request.setAttribute("id","request存储的 ");
          session.setAttribute("id","session存储的");



      %>

        <%--<%--%>
            <%--Object rid = request.getAttribute("rid");--%>
        <%--%>--%>
        <%--<%=rid%>--%>
      <%--request域在el表达式中叫 requestScope--%>
      ${requestScope.rid}
     <br/>
      ${sessionScope.sid}
     <%--简化格式 --%>
    <br/>
      ${rid} ${sid}
   <br/>
     ${id}


</body>
</html>
